//
//  WordsTestCardView.h
//  JPWords
//
//  Created by 梁淑婷 on 2024/7/8.
//

#import "JPCustomView.h"
#import "WordListModel.h"

NS_ASSUME_NONNULL_BEGIN

@class WordsTestCardView;

@protocol WordsTestCardViewDelegate <NSObject>

@optional

- (void)applyErrorTap:(WordsTestCardView*)wordsCardView;
- (void)collectTap:(WordsTestCardView*)wordsCardView andIsCollect:(BOOL)isCollect;
- (void)nextTap:(WordsTestCardView*)wordsCardView andIsKnow:(BOOL)isKnow;
- (void)speakText:(WordsTestCardView*)wordsCardView andText:(NSString*)text;
- (void)stopSpeak:(WordsTestCardView*)wordsCardView;
- (void)playAudio:(WordsTestCardView*)wordsCardView andAudio:(NSString*)audio;

@end

@interface WordsTestCardView : JPCustomView

@property(nonatomic,assign)NSInteger type;//1 第一个 2 第二个 3 第三个和第三个后面的
@property (nonatomic,weak)id<WordsTestCardViewDelegate>delegate;
@property(nonatomic,strong)WordListModel *model;
@property(nonatomic,assign)CGFloat currentAvailableWidth;
@property(nonatomic,assign)CGFloat currentAvailableHeight;
@property(nonatomic,strong)UIButton *knownBtn;
@property(nonatomic,strong)UIView *knowBgView;

-(void)speakJapaneseText:(NSString *)text;
-(void)playAudio:(NSString*)audio;
-(instancetype)initWithFrame:(CGRect)frame andCurrentAvailableWidth:(CGFloat)currentAvailableWidth andCurrentAvailableHeight:(CGFloat)currentAvailableHeight;
-(void)correctBtnClick;
-(void)errorBtnClick;

@end

NS_ASSUME_NONNULL_END
